package hu.rsc.forbiddenwords.shared;

import com.google.gwt.user.client.rpc.IsSerializable;

public abstract class BaseDTO implements IsSerializable {
    private Long id;

    public BaseDTO() {
    }

    public BaseDTO(Long id) {
	this.id = id;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj) {
	    return true;
	}
	if (obj == null) {
	    return false;
	}
	if (getClass() != obj.getClass()) {
	    return false;
	}
	BaseDTO other = (BaseDTO) obj;
	if (this.id == null) {
	    if (other.id != null) {
		return false;
	    }
	} else if (!this.id.equals(other.id)) {
	    return false;
	}
	return true;
    }

    public Long getId() {
	return this.id;
    }

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
	return result;
    }

    public void setId(Long id) {
	this.id = id;
    }

}
